package cn.achao.csr.chat.dao;

import cn.achao.csr.api.model.entity.ChatMsgMark;
import cn.achao.csr.api.model.enums.NormalOrNoEnum;
import cn.achao.csr.chat.mapper.ChatMsgMarkMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;

import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;

import java.util.List;

@Slf4j
@Service
@RequiredArgsConstructor
public class ChatMsgMarkDao extends ServiceImpl<ChatMsgMarkMapper, ChatMsgMark> {

    private final ChatMsgMarkMapper msgMarkMapper;

    public List<ChatMsgMark> getValidMarkByMsgIdBatch(List<Long> msgIds) {
        return lambdaQuery()
                .in(ChatMsgMark::getMsgId, msgIds)
                .eq(ChatMsgMark::getStatus, NormalOrNoEnum.NORMAL.getStatus())
                .list();
    }
}

